import { CHANNEL_SAVE_LIST, CHANNEL_UPDATE_ID } from '../action/actionType';

const initialState = {
  list: [],
  current: 0,
};

export default function channelReducer(state = initialState, { type, payload }) {
  switch (type) {
    case CHANNEL_SAVE_LIST:
      return { ...state, list: payload };
    case CHANNEL_UPDATE_ID:
      return { ...state, current: payload };

    default:
      return state;
  }
}
